package ch.bfh.ti.barcode;

import ch.bfh.ti.barcode.exception.EncodeException;

/**
 * This interface describes a class with the ability to transform raw data into
 * a barcode image.
 * 
 * @author Dominik von Burg
 * 
 */
public interface CodeGenerator {
	/**
	 * This method converts binary data into a barcode image. The image is
	 * returned as a bitmap in the ARGB format. Any kind of data can be
	 * converted to a barcode.
	 * 
	 * @param data
	 *            Any kind of binary data to convert into a barcode.
	 * @return A image with the barcode. The image has to be in the ARGB format.
	 * @throws EncodeException
	 *             Something went wrong with the conversion or generation of the
	 *             image.
	 */
	public int[] generate(byte[] data) throws EncodeException;

	/**
	 * This method returns the capacity of the code. Its the maximum size of the
	 * byte array you send with the {@link CodeGenerator#generate(byte[])} method.
	 * 
	 * @return The capacity of the code.
	 */
	public int getCodeSize();
}
